package com.fit.service;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;

import com.fit.interfaces.Reservation;

public class ReservationsBean implements Reservations {

	private Map<String, Reservation> reservations = new HashMap<String, Reservation>();
	
	/* (non-Javadoc)
	 * @see com.fit.service.Reservations#save(com.fit.interfaces.Reservation)
	 */
	public Reservation save(Reservation reservation){
		return reservations.put(reservation.getIdOfReservation(), reservation);
	}
	
	/* (non-Javadoc)
	 * @see com.fit.service.Reservations#retriveSingleReservation(java.lang.String)
	 */
	public Reservation retriveSingleReservation(String id){
		return reservations.get(id);
	}
	
	/* (non-Javadoc)
	 * @see com.fit.service.Reservations#retrive()
	 */
	public Collection<Reservation> retrive(){
		return reservations.values();
	}
}
